package jsd2302.src.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/*
简单的记事本工具
 */
public class TestNote {
    public static void main(String[] args) throws IOException {

        FileOutputStream fos=new FileOutputStream("note.txt");
        Scanner scan = new Scanner(System.in);
        while(true) {
                String line = scan.nextLine();
                if("exit".equals(line)){
                    break;
                }
            fos.write(line.getBytes(StandardCharsets.UTF_8));
        }
        System.out.println("结束了！");

        fos.close();
    }
}
